package org.jackysoft.opensymphony.workflow.entity;

import javax.persistence.Id;

import org.apache.struts2.json.annotations.JSON;
import org.jackysoft.annotations.BID;
import org.jackysoft.workflow.WorkItem;




public class WorkflowName extends WorkItem{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String workflowName;

	private WorkflowDescriptor workflowDescriptor;

	private String imagePath;
	
	private String remark;
	
	private boolean enabled = true;

	// ~ Methods
	// ////////////////////////////////////////////////////////////////

	public WorkflowName() {
		super();
	}
	public WorkflowName(String workflowName) {
		super();
		this.workflowName = workflowName;
	}	
	public WorkflowName(String workflowName, String imagePath, String remark,boolean enabled) {
		this(workflowName);
		this.imagePath = imagePath;
		this.remark = remark;
		this.enabled = enabled;
	}
	
	public String getRemark() {
		return remark;
	}


	


	public void setRemark(String remark) {
		this.remark = remark;
	}


	public boolean isEnabled() {
		return enabled;
	}


	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}


	


	public void setWorkflowDescriptor(WorkflowDescriptor workflowDescriptor) {
		this.workflowDescriptor = workflowDescriptor;
	}

	@JSON(serialize=false)
	public WorkflowDescriptor getWorkflowDescriptor() {
		if(this.workflowDescriptor!=null)
			this.workflowDescriptor.setWorkflowName(workflowName);
		return workflowDescriptor;
	}

	public void setWorkflowName(String workflowName) {
		this.workflowName = workflowName;
	}

	
	@Id@BID
	public String getWorkflowName() {
		return workflowName;
	}

	public String getImagePath() {
		return imagePath;
	}


	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}
}